package com.jinsi.controller.zhu;

import com.jinsi.service.zhu.HomeOverviewService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 获取主页信息
 * @author 朱浩榕
 * @Date 2022-10-19
 */
@RestController
@RequestMapping("/homedata")
@Slf4j
public class HomeOverviewController {

    @Autowired
    private HomeOverviewService homeOverviewService;

    /**
     * 查询商品已上架的数量
     * @return
     */
    @RequestMapping("/getCommodityQuantity")
    public int getCommodityQuantity(){
        int a = homeOverviewService.getCommodityQuantity();
        return a;
    }

    /**
     * 查询课程已上架的数量
     * @return
     */
    @RequestMapping("/getConstantQuantity")
    public int getConstantQuantity(){
        int a = homeOverviewService.getConstantQuantity();
        return a;
    }

    /**
     * 查询上传的课程视频总量
     * @return
     */
    @RequestMapping("/getCourseVideo")
    public int getCourseVideo(){
        int a = homeOverviewService.getCourseVideo();
        return a;
    }

    /**
     * 查询课程视频点赞总量
     * @return
     */
    @RequestMapping("/getTotalNumberOfVideoLikes")
    public int getTotalNumberOfVideoLikes(){
        int a = homeOverviewService.getTotalNumberOfVideoLikes();
        return a;
    }


    /**
     * 查询课程视频收藏总量
     * @return
     */
    @RequestMapping("/getCurrculumCollectionQuantity")
    public int getCurrculumCollectionQuantity(){
        int a = homeOverviewService.getCurrculumCollectionQuantity();
        return a;
    }



    /**
     * 查询所有用户的数量
     * @return
     */
    @RequestMapping("/getNumberOfAllUsers")
    public int getNumberOfAllUsers(){
        int a = homeOverviewService.getNumberOfAllUsers();
        return a;
    }


    /**
     * 查询当日用户的数量
     * @return
     */
    @RequestMapping("/getCurrentDayUser")
    public int getCurrentDayUser(){
        int a = homeOverviewService.getCurrentDayUser();
        return a;
    }

    /**
     * 查询昨日用户的数量
     * @return
     */
    @RequestMapping("/getYesterdayUser")
    public int getYesterdayUser(){
        int a = homeOverviewService.getYesterdayUser();
        return a;
    }

    /**
     * 查询本月新增用户的数量
     * @return
     */
    @RequestMapping("/getUsersOfThisMonth")
    public int getUsersOfThisMonth(){
        int a = homeOverviewService.getUsersOfThisMonth();
        return a;
    }

}
